package com.muyu.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName: LogInfo
 * @Author: Zirun.Xin
 * @Date: 2025/3/20 下午1:53
 * @Version: 1.0
 * @Description: 日志信息实体
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "log_info", autoResultMap = true)
public class LogInfoEntity implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 日志类型
     */
    @TableField(value = "type")
    private String type;

    /**
     * 接口名称
     */
    @TableField(value = "operation")
    private String operation;

    /**
     * 接口返回状态码
     */
    @TableField(value = "response_code")
    private String responseCode;

    /**
     * 请求时间
     */
    @TableField(value = "operate_time")
    private Date operateTime;

    /**
     * 消耗时间
     */
    @TableField(value = "spend_time")
    private Long spendTime;

    /**
     * url
     */
    @TableField(value = "url")
    private String url;

    /**
     * 请求体
     */
    @TableField(value = "body")
    private String body;

    /**
     * ip
     */
    @TableField(value = "ip")
    private String ip;

    /**
     * 查询参数
     */
    @TableField(value = "query")
    private String query;

    /**
     * 异常信息
     */
    @TableField(value = "exception")
    private String exception;
}
